GDK-Win32: Clean up HiDPI support and WGL a bit
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 19 Jul 2021 10:20:09 +0000 (18:20 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 19 Jul 2021 10:30:42 +0000 (18:30 +0800)
commitac64d2d910c3e5068f7376b55267aecc68489d79
treee7ebb98ca3d7d618194d56e7a27d4e4d21b829cc
parent49a76257cd832cf845eecf152fb374747b44626d
GDK-Win32: Clean up HiDPI support and WGL a bit

Make _gdk_win32_display_get_monitor_scale_factor() less complex, by:

*  Drop the preceding underscore.

*  Dropping an unused parameter.

*  Using a GdkSurface instead of a HWND, as the HWND that we pass into
   this function might have been taken from a GdkSurface, which are now
   always created with CS_OWNDC.  This means if a GdkSurface was passed
   in, we ensure that we only acquire the DC from the HWND once, and do
   not attempt to call ReleaseDC() on it.

*  Store the HDC that we acquire from the GdkSurface's HWND into the
   surface, and use that as the HDC we need for our GdkGLContext.

*  Drop the gl_hwnd from GdkWin32Display, as that is really should be
   stored in the GdkSurface.

*  For functions that were updated, name GdkWin32Display variables as
   display_win32 and GdkSurface variables as surface, to unify things.

*  Stop calling ReleaseDC() on the HDC that we use for OpenGL, since
   they were acquired from HWND's created with CS_OWNDC.
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkdisplay-win32.h
gdk/win32/gdkdrag-win32.c
gdk/win32/gdkdrop-win32.c
gdk/win32/gdkglcontext-win32.c
gdk/win32/gdkmonitor-win32.c
gdk/win32/gdkscreen-win32.c
gdk/win32/gdksurface-win32.c